﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace CommunityToolkitMvvmDemo.Converters
{
    internal class BooleanToVisibilityConverter : IValueConverter
    {
        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (parameter == null) 
                return (bool)value ? Visibility.Hidden : Visibility.Visible;  // 不传参数
            else
                return (bool)value ? Visibility.Visible : Visibility.Hidden; // 传参数
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
